package Visitor.After;

import java.util.ArrayList;
import java.util.List;

/**
 * A solution is to use the visitor pattern. So lets say we
 * wanted to create a bunch of code that doesn't require us to change every
 * single class every single time.
 *
 */
public class Game
{
    public static void main( String[] args )
    {
        List<Enemy> enemies = new ArrayList<Enemy>();

        for( Enemy enemy : enemies )
        {

        }
    }
}

abstract class Enemy
{
    int hitPoints;


    void acceptVisit( Visitor visitor )
    {
        visitor.visit( this );
    }
}

/**
 * Very resiliant guy. He's used to the pain of his own stink
 * so your sword can't hurt him much. Makes perfect sense!
 */
class StinkyEnemy extends Enemy
{

    int getTotalHitPointsLeft( int pointsPerHit )
    {

    }
}
/**
 * Poor vision is killing this guy. He doesn't even know
 * where you are half the time, so each time you hit him
 * you get even more than normal damage.
 */
class OneEyedEnemy extends Enemy
{
    int getTotalHitPointsLeft( int pointsPerHit )
    {
        return hitPoints / ( pointsPerHit * 2 );
    }
}

/**
 * This primate is a major pain in the butt. He won't
 * stop hopping around and smacking you with bananas,
 * which makes it tough to hit him. When you do you
 * aren't getting in good shots you
 */
class MonkeyEnemy extends Enemy
{

    @Override
    int getTotalHitPointsLeft( int pointsPerHit )
    {
        return hitPoints / ( pointsPerHit / 20 );
    }
}

class Visitor
{
}

class HitsToDieVisitor
{
    public void visit( StinkyEnemy stinkyEnemy )
    {
        return hitPoints/(pointsPerHit/2);
    }

    public void visit( StinkyEnemy stinkyEnemy )
    {
        return hitPoints / ( pointsPerHit * 2 );
    }
}


